package org.jeecg.modules.pay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.pay.entity.AccountChange;
import org.jeecg.modules.pay.mapper.AccountChangeMapper;
import org.jeecg.modules.pay.service.IAccountChangeService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 账户变动记录
 * @Author: jeecg-boot
 * @Date:   2022-06-14
 * @Version: V1.0
 */
@Service
public class AccountChangeServiceImpl extends ServiceImpl<AccountChangeMapper, AccountChange> implements IAccountChangeService {

    @Override
    public IPage<AccountChange> getPage(Integer pageNo, Integer pageSize, QueryWrapper<AccountChange> queryWrapper) {
        Page<AccountChange> page = new Page<>(pageNo, pageSize);
        return page(page, queryWrapper);
    }

    @Override
    public void add(AccountChange accountChange) {
        save(accountChange);
    }

    @Override
    public AccountChange get(String id) {
        return getById(id);
    }

    @Override
    public IPage<AccountChange> getMyRecord(Integer pageNo, Integer pageSize, String id) {
        Page<AccountChange> page = new Page<>(pageNo, pageSize);
        return page(page, new QueryWrapper<AccountChange>().eq("id", id));
    }
}
